
<%@page import="java.util.ArrayList"%>
<%@page import="classes.Reports"%>
<form action="order.html">
    <table>
            <tr><td>Stock</td><td> <select name="stock">
            <% 
            Reports.getConnection("SELECT * FROM brchung.stock;");
            ArrayList<String[]> rs=Reports.getResults(1,4);

            for(int i=0;i<rs.size();i++)
            {
                out.println("<option value=\""+rs.get(i)[0] +" "+ rs.get(i)[1] +"\">"+rs.get(i)[0] + " ($"+rs.get(i)[1] + ")"+"</option>");
            }
            %>
            </select></td></tr>
            <tr><td>Account ID</td><td> <select name="acc">
            <% 
            Reports.getConnection("SELECT * FROM brchung.account;");
            ArrayList<String[]> rt=Reports.getResults(1);

            for(int i=0;i<rt.size();i++)
            {
                out.println("<option value=\""+rt.get(i)[0] +"\">"+rt.get(i)[0] +"</option>");
            }
            %>
            </select></td></tr>
        <tr><td>Price Type</td><td> <select name="price">
                    <option value="market">Market</option>
                    <option value="marketonclose">Market on Close</option>
                    <option value="trailingstop">Trailing Stop</option>
                    <option value="hiddenstop">Hidden Stop</option>
                </select></td></tr>
               <tr><td>Order Type</td><td> <select name="order">
                    <option value="buy">Buy</option>
                    <option value="sell">Sell</option>
                </select></td></tr>
               <tr><td>Number of Share</td><td><input name="share" type="text" class="textBox" maxlength="5" /></td></td></tr>
               <tr><td>Percentage</td><td><input name="percentage" type="text" class="textBox" maxlength="3" /></td></tr>
    </table>
    <input type="submit" Value="Submit"/>
</form>